Merged [20921], [20922], [20969], [20971]: Added MySpace service and account for...
[adiumx.git] / Plugins / Purple Service / PurpleMySpaceService.m
blob891d46f09081dac5e907007ab626d2c44b506da1
1 //
2 //  PurpleMyspaceService.m
3 //  Adium
4 //
5 //  Created by Evan Schoenberg on 9/11/07.
6 //
8 #import "PurpleMyspaceService.h"
9 #import "PurpleMyspaceAccount.h"
10 #import "PurpleMyspaceAccountViewController.h"
11 #import <Adium/AIStatusControllerProtocol.h>
12 #import <AIUtilities/AIImageAdditions.h>
14 @implementation PurpleMyspaceService
16 //Account Creation
17 - (Class)accountClass{
18         return [PurpleMyspaceAccount class];
21 - (AIAccountViewController *)accountViewController{
22     return [PurpleMyspaceAccountViewController accountViewController];
25 - (DCJoinChatViewController *)joinChatView{
26         return nil;
29 //Service Description
30 - (NSString *)serviceCodeUniqueID{
31         return @"libpurple-Myspace";
33 - (NSString *)serviceID{
34         return @"Myspace";
36 - (NSString *)serviceClass{
37         return @"Myspace";
39 - (NSString *)shortDescription{
40         return @"Myspace";
42 - (NSString *)longDescription{
43         return @"MyspaceIM";
45 - (NSCharacterSet *)allowedCharacters{
46         return [NSCharacterSet characterSetWithCharactersInString:@"+abcdefghijklmnopqrstuvwxyz0123456789@._-"];
48 - (NSCharacterSet *)ignoredCharacters{
49         return [NSCharacterSet characterSetWithCharactersInString:@""];
51 - (int)allowedLength{
52         return 999;
54 - (BOOL)caseSensitive{
55         return NO;
57 - (AIServiceImportance)serviceImportance{
58         return AIServiceSecondary;
61 - (void)registerStatuses{
62         [[adium statusController] registerStatus:STATUS_NAME_AVAILABLE
63                                                          withDescription:[[adium statusController] localizedDescriptionForCoreStatusName:STATUS_NAME_AVAILABLE]
64                                                                           ofType:AIAvailableStatusType
65                                                                   forService:self];
66         
67         [[adium statusController] registerStatus:STATUS_NAME_AWAY
68                                                          withDescription:[[adium statusController] localizedDescriptionForCoreStatusName:STATUS_NAME_AWAY]
69                                                                           ofType:AIAwayStatusType
70                                                                   forService:self];
72         [[adium statusController] registerStatus:STATUS_NAME_INVISIBLE
73                                                          withDescription:[[adium statusController] localizedDescriptionForCoreStatusName:STATUS_NAME_INVISIBLE]
74                                                                           ofType:AIInvisibleStatusType
75                                                                   forService:self];
78 /*!
79  * @brief Default icon
80  *
81  * Service Icon packs should always include images for all the built-in Adium services.  This method allows external
82  * service plugins to specify an image which will be used when the service icon pack does not specify one.  It will
83  * also be useful if new services are added to Adium itself after a significant number of Service Icon packs exist
84  * which do not yet have an image for this service.  If the active Service Icon pack provides an image for this service,
85  * this method will not be called.
86  *
87  * The service should _not_ cache this icon internally; multiple calls should return unique NSImage objects.
88  *
89  * @param iconType The AIServiceIconType of the icon to return. This specifies the desired size of the icon.
90  * @return NSImage to use for this service by default
91  */
92 - (NSImage *)defaultServiceIconOfType:(AIServiceIconType)iconType
94         return [NSImage imageNamed:((iconType == AIServiceIconSmall) ? @"myspace-small" : @"myspace-small")
95                                           forClass:[self class]];
98 @end